package com.meida.bpm.provider.controller;


import com.meida.bpm.client.entity.FlowForm;
import com.meida.bpm.provider.service.FlowFormService;
import com.meida.common.mybatis.model.ResultBody;
import com.meida.common.springmvc.base.BaseController;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * 表单管理
 *
 * @author zyf
 */
@RestController
@RequestMapping("/flowable/form")
public class FlowFormController extends BaseController<FlowFormService, FlowForm> {


    /**
     * form列表
     *
     * @return
     */
    @GetMapping(value = "/list")
    public ResultBody list(@RequestParam(required = false) Map params) {
        return bizService.pageList(params);

    }

    @GetMapping(value = "/get")
    public ResultBody queryById(@RequestParam(required = false) Map params) {
        return bizService.get(params);
    }

    /**
     * 添加表单
     */
    @PostMapping(value = "save")
    public ResultBody save(@RequestParam(required = false) Map params) {
        return bizService.add(params);
    }

    /**
     * 修改表单
     */
    @PostMapping(value = "update")
    public ResultBody update(@RequestParam(required = false) Map params) {
        return bizService.edit(params);
    }

    /**
     * 删除表单
     */
    @PostMapping(value = "delete")
    public ResultBody delete(@RequestParam(required = false) Map params) {
        return bizService.delete(params);
    }
}
